﻿
namespace SharePoint.Contrib.Diagnostics
{
    internal static class AreaFactory
    {
        public static Area Create(string name, params string[] categories)
        {
            return new FactoryArea(name, categories);
        }        
    }

    internal class FactoryArea : Area
    {
        private string name;
        private string[] categories;

        public override string Name
        {
            get { return name; }
        }

        public override string[] Categories
        {
            get
            {
                if (this.categories == null)
                {
                    return new string[0];
                }
                return categories;
            }
        }

        public FactoryArea(string name, params string[] categories)
        {
            this.name = name;
            this.categories = categories;
        }
    }
}
